Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    The problem is with
    after having run the first 3 lines separately
    With local macros you cannot run lines separately. The local macros, whether initialized directly in the master do-file or in the -include-d header file, will not survive beyond the end of a block lines that are run separately. This is true of all local macros in Stata. If you initialize them in a group of lines (or single line) run separately, they will not be available for use after that.

    If your master do-file is in a developmental state and you are trying to build it up in blocks, you must either:
    1. Always run the entire do-file without interruption from beginning up to either its end or the point where you want it to stop while you are seeing what happens.
    Or, if that is too time-consuming because the intervening code runs too long:
    2. Comment out the intermediate code and then run the do file without interrupt from beginning to end (or stopping point).

    But do not run groups of lines separately when local macros are being used.

    Comment


    • #17
      Thanks for clarifying, Clyde Schechter. I somehow presumed that putting the initialization file in the PERSONAL ado directory, the locals gain some global characteristics when used in a master do file. I will build my master do file based on your suggestions.

      Comment

      Working...
      X